#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
//template<class T>
//void Swap(T& x, T& y)
//{
//	T tmp = x;
//	x = y;
//	y = tmp;
//}

template<class T>
T Add(const T& left, const T& right)
{
	return left + right;
}

template<class M>
M sum( const M &x, const M &y)
{
	return x + y;
}

template<typename t>
t* f(int n)
{
	t* p = new t[n];
	return p;
}

template<class T>
class Stack
{
public:
	Stack(int capacity = 4)
	{
		cout << "Stack(int capacity = 4)" << endl;

		_a = new T[capacity];
		_top = 0;
		_capacity = capacity;
	}

	~Stack()
	{
		cout << "~Stack()" << endl;

		delete[] _a;
		_a = nullptr;
		_top = 0;
		_capacity = 0;
	}
private:
	T* _a;
	int  _top;
	int  _capacity;
};
int& func(int &cc)
{
	cc ++;
	return cc;
}

const int func1()
{
	return 1;
}
int main()
{
	int a = 1, b = 2;
	//Swap<int>(a, b);
	double s=sum<double>(a, b);
	double ss=Add<double>(a, b);
	double* p1=f<double>(10);
	//Stack<int> t1;
	//Stack<double> t1;
	int xxx = 2;
	 int xy=func(xxx);
	 cout << xy << endl;
	 cout << xxx << endl;
	
	 
	return 0;
}